package com.tao.controller;

import com.alibaba.druid.support.json.JSONUtils;
import com.tao.service.PictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @author xiayunhong
 */
@Controller
public class PictureController {
    @Autowired
    private PictureService pictureService;
    @RequestMapping("/pic/upload")
    @ResponseBody
    public String PictureUpload(MultipartFile uploadFile){
        Map map = pictureService.uploadPicture(uploadFile);
        String s = JSONUtils.toJSONString(map);
        return s;
    }
}
